<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="/resources/template/template.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="content">
        <h:form>
            <p:panel header="Pharmaceutical Item With Distributor" >

                <p:commandButton ajax="false" value="Refresh"
                                 action="#{pharmacySaleReport.createItemWithMultipleDistributor()}"/>


                <p:panel id="paItems">
                    <p:dataTable value="#{pharmacySaleReport.itemsWithDistributers}" var="it" >
                        <f:facet name="header">
                            <p:outputLabel value="Pharmaceutical Item With Multiple Distributor" />
                        </f:facet>
                        <p:columnGroup type="header" >
                            <p:row>
                                <p:column headerText="Dealor" />
                            </p:row>
                        </p:columnGroup>
                        <p:subTable value="#{it.institutions}" var="i"  >
                            <f:facet name="header">
                                <p:outputLabel value="Item Code : #{it.item.code}" style="float: right"/>
                                <p:outputLabel value="Item Name : #{it.item.name}" />
                            </f:facet>
                            <p:column headerText="Dealor">
                                <p:outputLabel value="#{i.name}"></p:outputLabel>
                            </p:column>
                            
                        </p:subTable>
                    </p:dataTable>
                </p:panel>


            </p:panel>
        </h:form>


    </ui:define>


</ui:composition>
